// 
// $Rev:: 27            $:  Revision of last commit
// $Author:: rvhaverm@g#$:  Author of last commit
// $Date:: 2010-07-26 1#$:  Date of last commit
// 
package agents.core;

import java.util.ArrayList;

import agents.configuration.IHostConfiguration;
import agents.interfaces.IAgentEventListener;
import agents.interfaces.IAgentHost;
import agents.interfaces.IHostEventListener;
import agents.interfaces.ILogger;
import agents.listeners.ConsoleAgentEventListener;
import agents.listeners.ConsoleHostEventListener;
import agents.logging.ConsoleLogger;


public class Components
{
    private static Components _instance = null;

    public static Components Instance()
    {
	if (_instance == null)
	{
	    _instance = new Components();
	}
	return _instance;
    }

    private ILogger _logger = null;
    private ArrayList<IAgentEventListener> _agentEventListeners = null;
    private ArrayList<IHostEventListener> _hostEventListeners = null;
    private IAgentHost _agentHost = null;
    private IHostConfiguration _configuration = null;

    private Components()
    {
	_agentEventListeners = new ArrayList<IAgentEventListener>();
	_hostEventListeners = new ArrayList<IHostEventListener>();

    }

    public ILogger getLogger()
    {
	return _logger;
    }

    public void setLogger(ILogger logger)
    {
	_logger = logger;
    }

    public ArrayList<IAgentEventListener> getAgentEventListeners()
    {
	return _agentEventListeners;
    }

    public ArrayList<IHostEventListener> getHostEventListeners()
    {
	return _hostEventListeners;
    }

    public void setAgentHost(IAgentHost agentHost)
    {
	this._agentHost = agentHost;
    }

    public IAgentHost getAgentHost()
    {
	return _agentHost;
    }

	public void setConfiguration(IHostConfiguration configuration) 
	{
		this._configuration = configuration;
	}

	public IHostConfiguration getConfiguration() 
	{
		return _configuration;
	}

}
